﻿Module Common
    Sub Log(ByVal message As String)
        Dim sb As New System.Text.StringBuilder
        Dim body As New System.Text.StringBuilder
        Dim oWrite As System.IO.StreamWriter
        sb.Append(My.Application.Info.DirectoryPath)
        sb.Append(String.Format("\" + "SSRS" + "_{0}.log", DateTime.Now.ToString("ddMMyyyy")))
        body.Append(message)
        If Not System.IO.File.Exists(sb.ToString()) Then
            oWrite = IO.File.CreateText(sb.ToString())
        Else
            oWrite = New System.IO.StreamWriter(sb.ToString(), True)
        End If
        oWrite.WriteLine(body.ToString())
        oWrite.Close()
        oWrite.Dispose()
    End Sub

End Module
